package com.spring.boot.demo.test;

import com.spring.boot.demo.config.DemoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author ZhuYouBin
 * @version 1.0.0
 * @Date: 2022/10/29 23:10
 * @Description
 */
@RestController
@RequestMapping("/api")
public class DemoController {

    // 自动装配我们自定义starter里面的类
    @Autowired
    private DemoService demoService;

    @GetMapping("/starter")
    public void demo() {
        // 调用自定义的starter里面的方法
        demoService.testMethod("Hello SpringBoot.");
    }

}
